home *** CD-ROM | disk | FTP | other *** search
/ All for Cell Phones: Sony Ericsson / Sony-Ericsson 2004.iso / Java / Marslander / Marslander.jar / l.class (.txt) < prev    next >
Encoding:
Java Class File  |  2002-01-18  |  2.6 KB  |  129 lines

  1. import com.siemens.mp.game.GraphicObjectManager;
  2. import java.util.Random;
  3.  
  4. // $FF: renamed from: l
  5. public class class_0 {
  6.    public int positionX;
  7.    public int positionY;
  8.    // $FF: renamed from: a j
  9.    private j field_0;
  10.    public d crystal;
  11.    public d arrow;
  12.    // $FF: renamed from: b int
  13.    private int field_1;
  14.    // $FF: renamed from: c boolean
  15.    private boolean field_2;
  16.    // $FF: renamed from: d k
  17.    private k field_3;
  18.    // $FF: renamed from: e i
  19.    private i field_4;
  20.    // $FF: renamed from: f int
  21.    private int field_5 = 0;
  22.    // $FF: renamed from: g int
  23.    private int field_6 = 10;
  24.    // $FF: renamed from: h int
  25.    private int field_7 = 500;
  26.    // $FF: renamed from: i int
  27.    private int field_8;
  28.    // $FF: renamed from: j java.util.Random
  29.    private Random field_9;
  30.    // $FF: renamed from: k boolean
  31.    private boolean field_10;
  32.  
  33.    public class_0(f var1, GraphicObjectManager var2, i var3, Random var4, k var5, boolean var6) {
  34.       this.field_10 = var6;
  35.       this.field_9 = var4;
  36.       this.field_4 = var3;
  37.       this.field_3 = var5;
  38.       this.field_1 = 100;
  39.       this.field_2 = false;
  40.  
  41.       try {
  42.          this.crystal = var1.getSprite("res\\game_crystal.spr");
  43.          var2.addObject(this.crystal.getSprite());
  44.          this.arrow = var1.getSprite("res\\game_downarrow.spr");
  45.          var2.addObject(this.arrow.getSprite());
  46.       } catch (Exception var8) {
  47.          System.out.println("Exception: " + var8);
  48.       }
  49.  
  50.    }
  51.  
  52.    public boolean collected() {
  53.       return this.field_1 == 0;
  54.    }
  55.  
  56.    public int getPositionX() {
  57.       return this.positionX;
  58.    }
  59.  
  60.    public int getPositionY() {
  61.       return this.positionY;
  62.    }
  63.  
  64.    public void runFrame() {
  65.       if (this.field_2) {
  66.          if (this.field_1 == 100 && this.field_10) {
  67.             this.field_4.ad.play();
  68.          }
  69.  
  70.          this.field_1 -= 4;
  71.          this.crystal.setFrame((100 - this.field_1) / 25);
  72.          if (this.crystal.getFrame() >= 4) {
  73.             this.field_1 = 0;
  74.             this.crystal.setVisible(false);
  75.             this.arrow.setVisible(false);
  76.          } else {
  77.             this.field_3.setScore(this.field_3.getScore() + this.field_8);
  78.             this.field_4.b(this.field_3.getScore());
  79.          }
  80.       } else {
  81.          --this.field_7;
  82.       }
  83.  
  84.    }
  85.  
  86.    public void setLevel(j var1) {
  87.       this.field_0 = var1;
  88.    }
  89.  
  90.    public void setPosition(int var1, int var2) {
  91.       this.positionX = var1;
  92.       this.positionY = var2 - 12;
  93.       this.crystal.setVisible(true);
  94.       this.arrow.setVisible(true);
  95.    }
  96.  
  97.    public void startCollecting() {
  98.       this.field_2 = true;
  99.       this.field_8 = (this.field_7 << 2) / 100;
  100.       if (this.field_8 < 2) {
  101.          this.field_8 = 2;
  102.       }
  103.  
  104.       if (this.field_8 > 30) {
  105.          this.field_8 = 30;
  106.       }
  107.  
  108.    }
  109.  
  110.    public void stopCollecting() {
  111.       this.field_2 = false;
  112.    }
  113.  
  114.    public void updatePosition() {
  115.       if (this.field_5 == 0) {
  116.          --this.field_6;
  117.       } else {
  118.          ++this.field_6;
  119.       }
  120.  
  121.       if (this.field_6 > 20 || this.field_6 < 0) {
  122.          this.field_5 ^= 1;
  123.       }
  124.  
  125.       this.crystal.setPosition(this.positionX - this.field_0.levelX, this.positionY - this.field_0.levelY);
  126.       this.arrow.setPosition(this.positionX - this.field_0.levelX + 4, this.positionY - this.field_0.levelY - 15 - (this.field_6 >> 1));
  127.    }
  128. }
  129.